import request from '@/utils/request'

// 查询菜单列表
export function listIndicatorImprovement(query) {
  return request({
    url: '/goldwind/performance/pt-target-rectify/selectPage',
    method: 'get',
    params: query
  })
}
// 查询菜单列表
export function exportImprovement(query) {
  return request({
    url: '/goldwind/performance/pt-target-rectify/selectPage',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
// 通过id获取详情页数据
export function editImprovement(id) {
  return request({
    url: `/goldwind/performance/pt-target-rectify/getReasonAndMeasures/?id=` + id ,
    method: 'get',
  })
}

// 提交原因分析的数据
export function addCauseAnalysis(data) {
  return request({
    url: '/goldwind/performance/pt-cause-analysis/addCauseAnalysis',
    method: 'post',
    data
  })
}
// 删除一行原因分析的数据
export function delCauseAnalysis(id) {
  return request({
    url: `/goldwind/performance/pt-cause-analysis/deleteById/?id=` + id,
    method: 'delete'
  })
}

// 提交改善措施的数据
export function addImprovements(data) {
  return request({
    url: '/goldwind/performance/pt-improvement-measures/addImprovementMeasures',
    method: 'post',
    data
  })
}
// 删除一行改善措施的数据
export function delImprovements(id) {
  return request({
    url: `/goldwind/performance/pt-improvement-measures/deleteById/?id=` + id,
    method: 'delete'
  })
}
// 提交整改反馈接口 
export function reqImprovements(data) {
  return request({
    url: '/goldwind/performance/pt-target-rectify/updatePtTargetRectify',
    method: 'put',
    data: data
  })
}